#pragma once

#include "ischeduler.hpp"

namespace tb {

namespace dispatch {

struct schedulers {
    enum SchedulerType {
        kThreadScheduler = 0,
        kImmediateScheduler,
        kTrampolineScheduler,
        kAsyncScheduler,
        kMainThreadScheduler
    }

    static IScheduler *CreateScheduler(SchedulerType) const;

    static void DestroyScheduler(IScheduler *) const;

    typedef IScheduler *(*SchdulerConstructor)();

    typedef void (*SchdulerDestructor)(IScheduler *);

    static void RegisterSchdulerFactory(SchedulerType, SchdulerConstructor, SchdulerDestructor);

    static void UnRegisterSchdulerFactory(Type);
};

} // end namespace dispatch

} // end namespace tb

